//
// Created by Feng on 25-2-21.
//
#include "iostream"
#include "windows.h"
using namespace std;
#define BMI 28

int main() {
    SetConsoleOutputCP(CP_UTF8);
    //遍历数组
    int arr[5] = {1, 2, 3, 4, 5};
    for (int i = 0; i < sizeof(arr) / sizeof(arr[0]); i++) {
        std::cout << "Hello, World!" << arr[i] << std::endl;
    }

    int a = 10;
    cout << sizeof(a) << endl;

    string name = "tom";
    cout << "hello " << name << endl;

    const string * p = &name; //指针赋值
    cout << *p << endl; //解引用
    cout << "a:" << p << endl; //指针地址
    cout << sizeof(p) << endl;


    cout << "肥胖数值bmi:" << BMI << endl;

    int age = 18;
    cout << "age:" + to_string(age) << endl; //字符串拼接

    string names[]={"a","b"};
    cout << "names:" << sizeof(names) << endl;
    for (int i = 0; i < sizeof(names) / sizeof(names[0]); i++) {
        cout << names[i] << endl;
    }

    int * p1=NULL; //空指针
    cout << p1 << endl;
    // int * p2; //野指针
    // cout << p2 << endl;
}
